<?php

namespace paper\component;

class Session
{


    public function open()
    {
        session_start();
    }

    public function close()
    {
        session_commit();
    }

    public function remove($name)
    {
        unset($_SESSION[$name]);
    }

    public function set($name, $value)
    {
        $_SESSION[$name] = $value;
    }

    public function get($name, $default = null)
    {
        return $_SESSION[$name] ?? $default;
    }
}